﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ThridGroup.ERP.Application.Contracts.DTO;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.Application.Contracts.ProductionSystem
{
    /// <summary>
    /// 点检保养项目服务接口
    /// </summary>
    public interface IMaintenanceplanServcices : IApplicationService
    {
        /// <summary>
        /// 获取分页列表
        /// </summary>
        /// <param name="input">查询条件</param>
        /// <returns>分页结果</returns>
        Task<PagedResultDto<MaintenanceplanDto>> GetListAsync(QueryMaintenanceplanDto input);

        /// <summary>
        /// 根据ID获取详情
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns>详情信息</returns>
        Task<MaintenanceplanDto> GetAsync(int id);

        /// <summary>
        /// 创建新项目
        /// </summary>
        /// <param name="input">创建数据</param>
        /// <returns>创建结果</returns>
        Task<MaintenanceplanDto> CreateAsync(CreateUpdateMaintenanceplanDto input);

        /// <summary>
        /// 更新项目
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <param name="input">更新数据</param>
        /// <returns>更新结果</returns>
        Task<MaintenanceplanDto> UpdateAsync(int id, CreateUpdateMaintenanceplanDto input);

        /// <summary>
        /// 删除项目
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns>删除结果</returns>
        Task DeleteAsync(int id);

        /// <summary>
        /// 批量删除项目
        /// </summary>
        /// <param name="ids">主键ID列表</param>
        /// <returns>删除结果</returns>
        Task DeleteBatchAsync(List<int> ids);

        /// <summary>
        /// 生成项目编码
        /// </summary>
        /// <param name="projectType">项目类型</param>
        /// <returns>新的项目编码</returns>
        Task<string> GenerateProjectCodeAsync(string projectType);

        /// <summary>
        /// 检查项目编码是否存在
        /// </summary>
        /// <param name="projectCode">项目编码</param>
        /// <param name="excludeId">排除的ID（用于修改时检查）</param>
        /// <returns>是否存在</returns>
        Task<bool> IsProjectCodeExistAsync(string projectCode, int? excludeId = null);

        /// <summary>
        /// 获取所有项目类型
        /// </summary>
        /// <returns>项目类型列表</returns>
        Task<List<string>> GetProjectTypesAsync();
    }
}
